package br.mestrado.unb.bs.model.constant;

/**
 * Define constants in simulator
 * @author paula
 *
 */
public interface DataPackageConstant {


	//header
	//constant values
	byte s_start_package 	= 127;
	byte s_end_package		= 126;
	byte s_start_payload	= 125;
	byte s_header_size		= 7; 

	//header
	//constant indexs
	int i_start_package 	= 0;
	int i_battery			= 1;
	int i_sample_frequency	= 2;
	int i_package_size		= 3;
	int i_payload_category	= 4;
	int i_start_payload 	= 5;
	int i_init_payload 		= 6;
	int i_end_payload 		= -1;

	//command indexs - relative view
	int i_command_value 			= 0;
	int i_command_sensor_category	= 1;
	int i_command_sensor_id			= 2;
	int i_command_new_value			= 3;
	
	
	//configuration
	byte command_payload_size 	= 4;
	byte command_category 		= 19;
	
	//commands
	byte comm_start_sensing_command 		= 1;
	byte comm_stop_sensing_command 			= 2;
	byte comm_change_sensor_accuracy_command= 3;
	byte comm_change_frequency_rate_command	= 4;
	byte comm_turn_off_sensor				= 5;
	byte comm_turn_on_sensor				= 6;
	byte comm_search_sensing_command 		= 7;

	
	//accelerometer = 20
	byte acc_payload_size 	= 3;
	byte acc_category 		= 20;
	byte i_x	= (byte)i_start_payload+1;
	byte i_y = (byte)i_start_payload+2;
	byte i_z = (byte)i_start_payload+2;
	
	//temperature = 21
	byte temp_payload_size 	= (byte)2;
	byte temp_category 		= (byte)21;
	byte i_temperature_low 	= (byte)i_start_payload+1;
	byte i_temperature_high = (byte)i_start_payload+2;

	//spo2 = 22
	byte spo2_payload_size 	= (byte)4;
	byte spo2_category 		= (byte)22;
	byte i_percentage_spo2_low 	= (byte)i_start_payload+1;
	byte i_percentage_spo2_high = (byte)i_start_payload+2;
	byte i_pulse_rate_spo2_low 	= (byte)i_start_payload+3;
	byte i_pulse_rate_spo2_high = (byte)i_start_payload+4;
	
	//ecg = 23
	byte ecg_payload_size 	= (byte)2;
	byte ecg_category 		= (byte)23;
	byte i_pulse_rate_ecg_low 	= (byte)i_start_payload+1;
	byte i_pulse_rate_ecg_high = (byte)i_start_payload+2;

	
	
	/**
	 * sensor configuration
	 */
	
	float DEFAULT_MIN_ACC_PERIOD= 1000; //	1 SEGUNDO
	float DEFAULT_MAX_ACC_PERIOD= 10000;//	10 SEGUNDOS
	float DEFAULT_ACC_PERIOD	= 4000; //	4 SEGUNDOS
	float DEFAULT_X 			= 0f;
	float DEFAULT_Y 			= 0f;
	float DEFAULT_Z 			= 0f;
	float DEFAULT_ACC_BATTERY 	= 90;
	
	float DEFAULT_MIN_TEMPERATURE_PERIOD= 1000; //	1 SEGUNDO
	float DEFAULT_MAX_TEMPERATURE_PERIOD= 10000;//	10 SEGUNDOS
	float DEFAULT_TEMPERATURE_PERIOD	= 4000; //	4 SEGUNDOS
	float DEFAULT_TEMPERATURE 			= 37.5f;
	float DEFAULT_TEMPERATURE_BATTERY 	= 90;
	
	float DEFAULT_MIN_SPO2_PERIOD	= 1000; //	1 SEGUNDOS
	float DEFAULT_MAX_SPO2_PERIOD	= 10000; //	10 SEGUNDOS
	float DEFAULT_SPO2_PERIOD		= 4000; //	4 SEGUNDOS
	float DEFAULT_SPO2_O2_PERCENTAGE 	= 98f;
	float DEFAULT_SPO2_PULSE_RATE 	= 80f;
	float DEFAULT_SPO2_BATTERY 	= 90;
	
	float DEFAULT_MIN_ECG_PERIOD	= 1000; //	1 SEGUNDOS
	float DEFAULT_MAX_ECG_PERIOD	= 10000; //	10 SEGUNDOS
	float DEFAULT_ECG_PERIOD		= 4000; //	4 SEGUNDOS
	float DEFAULT_ECG_PERCENTAGE 	= 98f;
	float DEFAULT_ECG_PULSE_RATE 	= 80f;
	float DEFAULT_ECG_BATTERY 	= 90;

	
	
	
}
